package com.ruoyi.owner.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.owner.mapper.OwnerMapper;
import com.ruoyi.owner.domain.Owner;
import com.ruoyi.owner.service.IOwnerService;

/**
 * 业主管理Service业务层处理
 *
 * @author HuangRong
 * @date 2023-05-12
 */
@Service
public class OwnerServiceImpl implements IOwnerService
{
    @Autowired
    private OwnerMapper ownerMapper;

    /**
     * 查询业主管理
     *
     * @param ownerId 业主管理主键
     * @return 业主管理
     */
    @Override
    public Owner selectOwnerByOwnerId(Long ownerId)
    {
        return ownerMapper.selectOwnerByOwnerId(ownerId);
    }

    /**
     * 查询业主管理列表
     *
     * @param owner 业主管理
     * @return 业主管理
     */
    @Override
    public List<Owner> selectOwnerList(Owner owner)
    {
        return ownerMapper.selectOwnerList(owner);
    }

    /**
     * 新增业主管理
     *
     * @param owner 业主管理
     * @return 结果
     */
    @Override
    public int insertOwner(Owner owner)
    {
        owner.setCreateTime(DateUtils.getNowDate());
        return ownerMapper.insertOwner(owner);
    }

    /**
     * 修改业主管理
     *
     * @param owner 业主管理
     * @return 结果
     */
    @Override
    public int updateOwner(Owner owner)
    {
        owner.setUpdateTime(DateUtils.getNowDate());
        return ownerMapper.updateOwner(owner);
    }

    /**
     * 批量删除业主管理
     *
     * @param ownerIds 需要删除的业主管理主键
     * @return 结果
     */
    @Override
    public int deleteOwnerByOwnerIds(Long[] ownerIds)
    {
        return ownerMapper.deleteOwnerByOwnerIds(ownerIds);
    }

    /**
     * 删除业主管理信息
     *
     * @param ownerId 业主管理主键
     * @return 结果
     */
    @Override
    public int deleteOwnerByOwnerId(Long ownerId)
    {
        return ownerMapper.deleteOwnerByOwnerId(ownerId);
    }
}
